#include "Rectangle.h"

CustomRectangle::CustomRectangle()
{

}
CustomRectangle::CustomRectangle(int X, int Y, int width,	int height)
{
	CustomRectangle::X = X;
	CustomRectangle::Y = Y;
	CustomRectangle::width = width;
	CustomRectangle::height = height;
}

bool CustomRectangle::Intersects(CustomRectangle rect)
{
	if (CustomRectangle::X + CustomRectangle::width < rect.GetX() ||
		CustomRectangle::X > rect.GetX() + rect.GetWidth() ||
		CustomRectangle::Y + CustomRectangle::GetHeight() < rect.GetY() ||
		CustomRectangle::Y > rect.GetY() + rect.GetHeight())
	{
		return false;
	}

	return true;
}

bool CustomRectangle::Contains(CustomRectangle rect)
{
	if (CustomRectangle::Left() > rect.Left() && CustomRectangle::Right() < rect.Right() &&
		CustomRectangle::Top() > rect.Top() &&  CustomRectangle::Bottom() < rect.Bottom())
	{
		return true;
	}

	return false;
}

bool CustomRectangle::Contains(Vector2 point)
{
	if (point.X > CustomRectangle::Left() && point.X < CustomRectangle::Right() &&
		point.Y > CustomRectangle::Top() && point.Y < CustomRectangle::Bottom())
	{
		return true;
	}

	return false;
}

bool CustomRectangle::Contains(float x, float y)
{
	if (x > CustomRectangle::Left() && x < CustomRectangle::Right() &&
		y > CustomRectangle::Top() && y < CustomRectangle::Bottom())
	{
		return true;
	}

	return false;
}